package br.com.datatraffic.restricao.domain.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data @EqualsAndHashCode(exclude = { "municipios" }, callSuper = false) @ToString(exclude = { "municipios" }) @Entity public class UF {
	@Id @SequenceGenerator(name = "UF_SEQ", sequenceName = "UF_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "UF_SEQ") @Column(name = "UF_ID", nullable = false) private Long id;
	private String nome;
	@OneToMany(mappedBy = "uf") private List<Municipio> municipios = new ArrayList<Municipio>(0);
}
